import React from "react";
import _ from 'lodash'
import { Empty } from "antd";
import TheBarChart from "@/components/TheBarChart";

const BarChart = ({ name, xData, yData }) => {
  return <React.Fragment>
    {
      !_.isEmpty(xData) && !_.isEmpty(yData) && <TheBarChart
        name={name}
        xData={xData}
        yData={yData}
      />
    }
    {
      _.isEmpty(xData) && _.isEmpty(yData) && <Empty />
    }
  </React.Fragment>
}
export default BarChart;